#!/bin/sh

mvn clean package

mkdir -p /opt/polygon/bin
mkdir -p /opt/polygon/compile
mkdir -p /opt/polygon/include

cp target/polygon-cli-1.0-dependencies.jar /opt/polygon/bin/polygon-cli-1.0.jar

cp target/classes/pgn.sh /usr/bin
chmod 755 /usr/bin/pgn.sh

cp target/classes/problem.sh /usr/bin
chmod 755 /usr/bin/problem.sh

cp target/classes/contest.sh /usr/bin
chmod 755 /usr/bin/contest.sh

cp target/classes/archive-contests.sh /usr/bin
chmod 755 /usr/bin/archive-contests.sh

cp target/classes/compile/compile-cpp.sh /opt/polygon/compile
chmod 755 /opt/polygon/compile/compile-cpp.sh

cp target/classes/compile/compile-pas.sh /opt/polygon/compile
chmod 755 /opt/polygon/compile/compile-pas.sh

cp target/classes/compile/compile-dpr.sh /opt/polygon/compile
chmod 755 /opt/polygon/compile/compile-dpr.sh

cp target/classes/compile/include/* /opt/polygon/include/
